/**
 * Created by Administrator on 2016/12/23 0023.
 */
//引包
var mongoose = require("mongoose");
var db = require("./db.js");

var studentSchema=new mongoose.Schema({
    name:{type:String},
    age:{type:Number},
    sex:{type:String}
});
studentSchema.statics.findByName= function (name, callback) {
     this.model("Student").find({name:name},callback)
}
studentSchema.statics.updateByName= function (conditions, update, options, callback) {
    this.model("Student").update(conditions,update,options,callback);
}
var studentModel=db.model("Student",studentSchema);

module.exports=studentModel;